from __future__ import annotations

from dataclasses import dataclass


@dataclass
class OutriggerPressure:
    max_pressure_kPa: float
    pad_area_m2: float
    ok: bool
    note: str


def compute_outrigger_pressure(reaction_kN: float, pad_area_m2: float, allowable_kPa: float = 200.0) -> OutriggerPressure:
    """吊车支腿地基压应力。"""

    p = reaction_kN * 1000.0 / max(1e-6, pad_area_m2)
    return OutriggerPressure(max_pressure_kPa=p, pad_area_m2=pad_area_m2, ok=p <= allowable_kPa, note="不满足则增大垫板")


